Welcome
To help you become familiar with XML Authoritytm we have included this step-by-step exercise to create a simple schema. This exercise will teach you how to navigate the product and introduce you to the fundamental features of XML Authority. This exercise should take around 15 minutes to complete. For more information about XML Authority, consult the Help Index.
The Example
In this example, you will build a sample Document Type Definition (DTD) for a price list. A document conforming to this schema could be used by a reseller to define the format in which they receive product information from manufacturers. Here is a guide to the information we'll be using.
price.list |
|
the "root" element inside of which all others will appear |
manufacturer |
|
a container for information about a manufacturer |
name |
|
the name of the manufacturer |
date.issued |
|
the date the price list was issued |
product |
|
a container for information about a product |
sku |
|
the product's sku (Stock Keeping Unit - Inventory Identifier) |
product.name |
|
the product's name |
price |
|
the product's price |
description |
|
a text description of the product |
promotion |
|
a container for information about a price promotion |
start.date |
|
the date the promotion starts |
end.date |
|
the date the promotion ends |
NOTE: The use of italics is for identifying the components of the schema and is used throughout this exercise.
For your reference, a complete example of this schema (quicktour.dtd) is included in the Samples directory. (Extensibility \ Samples \ quicktour.dtd)
Getting Started
fig 1.1 - Welcome to XML Authority
![]() |
Note: A single left click on the "Create a new schema" icon will open the default schema type specified by your Preferences. (The default is initially set as a DTD.) A right click (Ctrl+click for a Mac one-button mouse) on the icon allows you to select a different schema type from a drop down menu, as shown in fig 1.1. For the purposes of this quick tour, be sure to select a DTD. |
This will open the application and default to the Element Types pane. The Element Types pane presents an inventory of all of the element types whose tags are allowed within a document conforming to this schema. The top portion of the screen will display a graphical representation of your schema, the bottom portion is the work area, and where we will focus in the Quick Tour.
Here you can define attributes for an element. When entering multiple attributes, they should be separated by commas. XML Authority also has an Attribute Types pane that allows you to refine the attributes further.
NOTE: You can navigate around the tables in each pane by using ENTER, TAB, SHIFT-ENTER, and SHIFT-TAB.
Tab to the Content Model column and click on the Elem. checkbox to clear the checkbox. The Content Model column will change to Data Type. You need to provide the date.issued element with an appropriate data type. To further define this element, position your cursor in the Data Type column and select "date" from the Insert menu that appears. (fig 1.2) The Insert function can also be accessed by right clicking in this column. (Note: On a one button mouse, a right click can be performed by holding the Control key down while clicking.)
fig 1.2 - Content Model Insert Menu
NOTE: An element may contain some combination of text and elements or may contain some form of text with associated datatype
information.
1. Click the Elem. checkbox on the manufacturer row. Position the cursor inside the "( )" which are automatically created when editing an element's content model.
2. Type date.issued into the Content Model column to restrict the contents of manufacturer to one and only one date.issued element. Since 'name' is an attribute, it does not need to be within the manufacturer element.
fig 1.3 - Auto Create prompt
NOTE: If, as in the above content model, your input exceeds the column width, type Ctrl+E (Open Apple+E on Mac) or select "Expand" from the View menu to open a larger window for editing the selected area (fig 1.4). To exit this window, press Apply then Save to apply and save your work.
fig 1.4 - Content Model Editor
NOTE: The commas between element types are indicative of a Sequence (this followed by this followed by this). Element types may also represent a Choice (this or this or this). Choice uses a "|" rather than a "," between element type names. In the Content Model column, groups of elements can be EITHER Choices or Sequence.
NOTE: Elements can be defined as either required OR optional. They may also be
defined as repeatable by clicking on the Repeatable button in the Content Model toolbar. This definition will allow
for more than one instance of an element to appear in a content model.
Notice the price element type is being reused in a different context. That's perfectly okay in some situations, in others you may find it more convenient to use a different element type - the choice is yours.
NOTE: To further refine the definitions of these attributes, you can right-click on each of their names and choose "Go to <name>". This will bring up the Attribute pane with all the information about that attribute. Changing its data type to Date and making it required is left as an exercise for the reader. Use the navigation buttons on the toolbar (fig 1.5) at the top of the screen to move back and forth between the various panes.
fig 1.5 - XML Authority Toolbar
Reviewing the Schema
Graphical view
By defining what elements may be found within what elements, a structure for the document is established. This structure can be thought of as a tree where the "root" is the encompassing element and its branches are the elements that may be contained within it (as defined by the content model). In turn each branch may have branches defined by their content model. The diagram at the top of the Element Types pane provides a graphical view of these relationships. Explore the content model by clicking on the elements to expand and collapse their content. Note that only elements that define a content model can be expanded. Within the diagram, double clicking on the root element, in this case price.list, will produce a graphical view of the entire schema (fig 1.6).
fig 1.6 - Graphical view of completed schema
Right-click on an element in the diagram and choose "Go to
Element Type <name>" to
make this element active in the list of element type definitions. Right-Click on the background to zoom in or out of the diagram as a whole.
Source view
To view the actual schema syntax for the schema you've created, open the Source Pane by clicking on the Source Pane icon on the main toolbar (fig. 1.5). The Notes pane, which allows you to enter supplemental information about any element type or attribute, also allows you to view the source for individual declarations in a variety of schema dialects as well as in the format of an example XML document. Open the Notes Pane by clicking on the Notes Icon on the main toolbar (fig. 1.5). Click on the "Source Preview" tab at the bottom of the Notes Pane to view the source for the element declaration currently selected in the Elements List Pane. Note the "Preview As..." button which appears in the upper right hand corner of the Notes Pane. Click on this button to view the source in a different dialect or as an example XML document.
Conclusion
This Quick Tour serves as an introduction to XML Authority's basic interface. XML Authority's detailed help documents will help you learn more about XML Authority's functionality and facilitate your implementation of the more advanced features. To help you build better schemas, XML Authority also includes a guide to best practices for schema development.
You can also try out one of the more advanced features of XML Authority by completing the MetaSchema quick tour. In this exercise you will create a template for adorning the schema you just created with additional meta-data.
Thank You for choosing XML Authority from Extensibility.
If you have any questions please contact us at support@extensibility.com
Copyright 2000 Extensibility, Inc.
Suite 250, 200 Franklin Street, Chapel Hill, North Carolina 27516